import java.util.Scanner;

/**
 * Kotlin
 * 管理玩家的基本信息
 * 姓名 执棋类型 选择落子位置
 */
public class JPlayer {
    String name;
    JChessType chessType;

    public JPlayer(String name, JChessType chessType){
        this.name = name;
        this.chessType = chessType;
    }

    public JLocation chooseLocation(){
        return input();
    }

    private JLocation input(){
        Scanner scanner = new Scanner(System.in);
        while(true) {
            IOUtils.INSTANCE.showInput();
            try {
                int row = scanner.nextInt();
                int col = scanner.nextInt();
                scanner.close();
                return new JLocation(row, col);
            } catch (Exception e) {
                IOUtils.INSTANCE.showInputError();
            }
        }
    }
}
